/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package extension.room.analyse;

import log.Debug;

/**
 *
 * @author daz
 */
public class Card {

    public static void showName(int id) {
        Debug.d(getRank(id) + getSuit(id));

    }

    public static String getName(int id) {
        return getRank(id) + getSuit(id);
    }

    public static String getRank(int cardId) {
        int id = cardId % 13;
        if (id == 0) {
            return "A";
        } else if (id < 10) {
            return String.valueOf(id + 1);
        } else if (id == 10) {
            return "J";
        } else if (id == 11) {
            return "Q";
        } else {
            return "K";
        }
    }

    public static String getSuit(int cardId) {
        int id = cardId / 13;
        switch (id) {
            case 0:
                return "h";
            case 1:
                return "d";
            case 2:
                return "s";
            default:
                return "c";
        }
    }
}
